package com.zdp.filesync.utils;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import java.util.Objects;

@Component
public class SpringContextUtils implements ApplicationContextAware {

    public static ApplicationContext context;

    private SpringContextUtils(){}

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        if(Objects.isNull(context)){
            context = applicationContext;
        }
    }
}
